﻿using System;
using System.Drawing;

namespace _建造者模式
{
    internal class Program
    {
        static void Main(string[] args)
        {

        }
    }

    abstract class PersonBuilder
    {
        protected Graphics g;
        protected Pen p;
        public PersonBuilder(Graphics g, Pen p)
        {
            this.g = g;
            this.p = p;
        }
        public abstract void BuildHead();
        public abstract void BuildBody();
        public abstract void BuildArmLeft();
        public abstract void BuildArmRight();
        public abstract void BuildLegLeft();
        public abstract void BuildLegRight();




    }
    class PersonThinBuilder : PersonBuilder
    {
        public PersonThinBuilder(Graphics g, Pen p) : base(g, p)
        {

        }

        public override void BuildArmLeft()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }

        public override void BuildArmRight()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }

        public override void BuildBody()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }

        public override void BuildHead()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }

        public override void BuildLegLeft()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }

        public override void BuildLegRight()
        {
            g.DrawEllipse(p, 50, 20, 30, 30);
        }
    }

    class PersonDirector
    {
        private PersonBuilder pb;
        public PersonDirector(PersonBuilder pb)
        {
            this.pb = pb;
        }
    }
}
